<template>
  <view>
    <uni-pagination show-icon :page-size="queryParams.pageSize" :current="queryParams.pageNum" :total="total"
      @change="change" />
    <view class="btn-view;mainColor border-10">
      <view class="">
        <text class="colorB">当前页：{{ queryParams.pageNum }}，数据总量：{{ total }}条，每页数据：{{ queryParams.pageSize }}</text>
      </view>
      <view class="btn-flex ">
        <button class="button word-btn" hover-class="word-btn--hover" :hover-start-time="20" :hover-stay-time="70"
          @click="add"><text class="word-btn-white">增加10条数据</text></button>
        <button class="button" type="default" @click="reset" style="margin-left: 40rpx;">重置数据</button>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    name: "pagination",
    props: ['queryParams', 'total'],
    data() {
      return {
        pageNum: null,
        pageSize: null,
      };
    },
    methods: {
      change(e) {
        console.log(e, '切换');
        this.pageNum = e.current
        this.$emit('changeNum', this.pageNum)
      },
      add() {
        this.$emit('changeAdd')
      },
      reset() {
        this.$emit('reset')
      },
    }
  }
</script>